package com.after.saas.user.service.impl;

import com.after.saas.user.model.Menu;
import com.after.saas.user.mapper.MenuMapper;
import com.after.saas.user.service.MenuService;
import com.after.saas.common.model.vo.MenuVO;
import com.after.saas.common.utils.ListUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单权限表 服务实现类
 * </p>
 *
 * @author hjchen
 * @since 2021-07-17
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {


    public List<MenuVO> buildTree(List<MenuVO> menus, Menu menu) {
        List<MenuVO> list = ListUtil.copyList(menus, MenuVO.class);
        for (MenuVO m : menus) {
            if (m.getId().equals(menu.getParentId())) {
//                m.set
            }
        }

        return list;
    }

}
